package com.mexico.inloancash.india_presentimpl;


import com.mexico.inloancash.activity.IndiaLoginActivity;
import com.mexico.inloancash.india_basepresent.BasePresent;
import com.mexico.inloancash.callback.IndiaCallBack;
import com.mexico.inloancash.contract.IndiaLoginContract;
import com.mexico.inloancash.india_modelimpl.IndiaLoginModelImpl;

/**
 * @author zx
 * @description
 * @date 2020/1/15.
 */
public class IndiaLoginPresentImpl extends BasePresent<IndiaLoginActivity> implements IndiaLoginContract.LoginPresent {
    private IndiaLoginModelImpl model;
    @Override
    public void dealLogin(String username, String password) {
        model.login(username, password,new IndiaCallBack() {
            @Override
            public void success(String msg) {
                getView().goLayout(msg);
            }

            @Override
            public void failed(String msg) {
                getView().failed(msg);
            }
        });
    }

    @Override
    public void attachView(IndiaLoginActivity view) {
        super.attachView(view);
        model = new IndiaLoginModelImpl();
    }

    @Override
    protected IndiaLoginActivity getView() {
        return super.getView();
    }

    @Override
    public boolean isViewAttached() {
        return super.isViewAttached();
    }

    @Override
    public void detachView() {
        super.detachView();
    }
}
